function $(){return document.getElementById?document.getElementById(arguments[0]):eval(arguments[0]);}
var OverH,OverW,ChangeDesc,ChangeH=50,ChangeW=50;//速度
function OpenDiv(_Dw,_Dh,_Desc) {
$("Loading").innerHTML="";
OverH=_Dh;OverW=_Dw;ChangeDesc=_Desc;
$("Loading").style.display='';
if(_Dw>_Dh){ChangeH=Math.ceil((_Dh-10)/((_Dw-10)/50))}else if(_Dw<_Dh){ChangeW=Math.ceil((_Dw-10)/((_Dh-10)/50))}
$("Loading").style.top=(document.documentElement.clientHeight-10)/2+"px";
$("Loading").style.left=(document.documentElement.clientWidth-10)/2+"px";
OpenNow()
}
var Nw=10,Nh=10;
function OpenNow() {
if (Nw>OverW-ChangeW)ChangeW=2;
if (Nh>OverH-ChangeH)ChangeH=2;
Nw=Nw+ChangeW;Nh=Nh+ChangeH;

if(OverW>Nw||OverH>Nh) {
	if(OverW>Nw) {
	$("Loading").style.width=Nw+"px";

	//$("Loading").style.left=(mouseX = event.clientX)+"px";
	$("Loading").style.left=(document.documentElement.clientWidth-Nw)/2+"px";
	}
	if(OverH>Nh) {
	$("Loading").style.height=Nh+"px";
	//$("Loading").style.top=( mouseY = event.clientY)+"px"
	$("Loading").style.top=(document.documentElement.clientHeight-Nh)/2+"px"
	}
	window.setTimeout("OpenNow()",10)
	}else{
	Nw=10;Nh=10;ChangeH=50;ChangeW=50;
	$("Loading").innerHTML=ChangeDesc;
	}
	}




var docEle = function() {
  return document.getElementById(arguments[0]) || false;
}
function openNewDiv(_id,conter) {
  var m = "mask";
  var conter;
  if (docEle(_id)) document.removeChild(docEle(_id));
  if (docEle(m)) document.removeChild(docEle(m));
  // 新激活图层
  var newDiv = document.createElement("div");
  newDiv.id = _id;
  newDiv.style.position = "absolute";
  newDiv.style.zIndex = "9999";
  newDiv.style.width = "200px";
  newDiv.style.height = "300px";
  newDiv.style.top = "100px";
  newDiv.style.left = (parseInt(document.body.scrollWidth) - 300) / 2 + "px"; // 屏幕居中
  newDiv.style.background = "#EFEFEF";
  newDiv.style.border = "1px solid #860001";
  newDiv.style.padding = "5px";
  newDiv.innerHTML = conter;
  document.body.appendChild(newDiv);
  // mask图层
  var newMask = document.createElement("div");
  newMask.id = m;
  newMask.style.position = "absolute";
  newMask.style.zIndex = "1";
  newMask.style.width = document.body.scrollWidth + "px";
  newMask.style.height = document.body.scrollHeight + "px";
  newMask.style.top = "0px";
  newMask.style.left = "0px";
  newMask.style.background = "#000";
  newMask.style.filter = "alpha(opacity=40)";
  newMask.style.opacity = "0.40";
  document.body.appendChild(newMask);
  // 关闭mask和新图层
  var newA = document.createElement("a");
  newA.href = "#";
  newA.innerHTML = "关闭";
  newA.onclick = function() {
   document.body.removeChild(docEle(_id));
   document.body.removeChild(docEle(m));
   return false;
  }
  newDiv.appendChild(newA);
}
//切换面板

function setTab(m,n){
	 var tli=document.getElementById("menu"+m).getElementsByTagName("td");
	var mli=document.getElementById("main"+m).getElementsByTagName("tr");
	
	 for(i=0;i<tli.length;i++){
	  tli[i].className=i==n?"hover":"";
	  mli[i].style.display=i==n?"block":"none";
	 }
}
//导航二级菜单
function menuControl(show)
{
	window.event.cancelBubble=true;
	var objID=event.srcElement.id;
	var index=objID.indexOf("_");
	var mainID=objID.substring(0,index);
	var numID=objID.substring(index+1,objID.length);
	if(mainID=="menubar")
	{
	if(show==1)
	{
	eval("showMenu("+"menu_"+numID+")");
	}
	else
	{
	eval("hideMenu("+"menu_"+numID+")");
	}
	}
	
	}
	
	var nbottom=0,speed=7;
	function displayMenu(obj)
	{
	obj.style.clip="rect(0 100% "+nbottom+"% 0)";
	nbottom+=speed;
	if(nbottom<=100) 
	{
	timerID=setTimeout("displayMenu("+obj.id+"),70");
	}
	else clearTimeout(timerID);
	}
	function showMenu(obj)
	{
	obj.style.display="block";
	obj.style.clip="rect(0 0 0 0)";
	nbottom=5;
	displayMenu(obj);
	}
	function hideMenu(obj)
	{
	nbottom=0;
	obj.style.display="none";
	}
	function keepMenu(obj)
	{
	obj.style.display="block";
	}
//行换色
	function om(){
		document.getElementById("sort").style.background=='#9999FF';
	}
	function ou(){
		document.getElementById("sort").style.background=='';
	}

	
	